package com.muqiuhan.osmanthus.models

import java.util.Date

case class Task(
    name: Option[String],
    cronExpression: Option[String],
    invocation: Option[Invocation]
):
  def apply(): Task = Task(None, None, None)

  var id: Option[Long]     = None
  var pid: Option[Long]    = None
  var nodeID: Option[Long] = None

  var status: TaskStatus = TaskStatus.NOT_STARTED

  var successCount: Option[Int] = None
  var failCount: Option[Int]    = None
  var version: Option[Int]      = None

  var invocationInfo: Option[Array[Byte]] = None

  var firstStartTime: Option[Date] = None
  var nextStartTime: Option[Date]  = None

  var createTime: Date = new Date()
  var updateTime: Date = new Date()

end Task
